GXHandleChooserMessage
You can use theGXHandleChooserMessage
function to respond when a user selects a Chooser item for your printer driver.
OSErr GXHandleChooserMessage (gxJob *aJob, Str31 driverName, short message, short caller, StringPtr objName, StringPtr zoneName, ListHandle theList, long p2);
aJob
- A reference to a job object.
driverName
- The name of the printer driver; for example, "LaserWriter."
message
- The operation that is to be performed.
caller
- The caller. A value of 1 indicates the Chooser. Values in the range 0 to 127 are reserved; values outside of this range can be used by applications.
objName
- A pointer to other information. The value of this parameter depends on the value of the
message
parameter.zoneName
- The name of the AppleTalk zone containing the devices in the device list.
theList
- A handle to the List Manager list that contains the device choices that are displayed in the device list box.
p2
- Other information. The meaning of this parameter depends on the value of the
message
parameter.- function result
- An error code. The value
noErr
indicates that the operation was successful.DESCRIPTION
When the user interacts with your driver in the Chooser, the Chooser sends messages to your driver. What the Chooser sends depends on information in the package ('PACK'
) resource that you have defined for your driver. TheGXHandleChooserMessage
function makes it possible for your driver to work with the Chooser without you having to write the package-handling code.When the Chooser sends a message to your driver, you can call this function to allow QuickDraw GX to handle the Chooser actions for you. You can perform your own actions, depending on which message has been sent, and then pass the information that the Chooser sent to you along to this function, which takes care of the rest for you.
The messages that the Chooser can send to your driver are shown in Table 5-1.
RESULT CODES
gxSegmentLoadFailedErr A required code segment could not be found,
or there was not enough memory to load it.gxPrUserAbortErr The user has canceled printing. SEE ALSO
An example of using theGXHandleChooserMessage
function is shown in Listing 5-3 on page 5-9.Inside Macintosh: Devices describes the Chooser messages and package resources in detail.
Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help